package com.itheima.Demo01.demo01;

import java.io.IOException;
import java.net.*;

public class Network02 {
    public static void main(String[] args) throws IOException {
        DatagramSocket data = new DatagramSocket();
        String S = "真男人从不停歇";
        byte[] bytes = S.getBytes();
        InetAddress byName = InetAddress.getByName("127.0.0.1");
        DatagramPacket dp = new DatagramPacket(bytes,bytes.length,byName,10000);
        data.send(dp);
        data.close();

    }
}
